<!DOCTYPE html>
<html style="background-color: #000000;">
	<head>
		<meta charset="utf-8">
		<title>欢迎进入游戏界面</title>
		<style type="text/css">
			.div1 {
				width: 94.8125rem;
				height: 44.125rem;
			}

			#img_r {
				/* border: 1px solid #FF0000; */
				width: 200px;
				height: 200px;
			}
		</style>
	</head>
	<script src="../js/jquery-3.5.1.min.js">
	</script>

	<script type="text/javascript">
		$(function(eve) {
			$(".div1").mousedown(function(e) {
				var x = e.pageX-100;//获取鼠标点击的x轴坐标
				var y = e.pageY-100;//获取鼠标点击的y轴坐标
				var img_x = $("img").offset().left;//获取图片当前的x轴坐标
				var img_y = $("img").offset().top;//获取图片当前的x轴坐标
				// $("#img_r").css({"left":x,"top":y});
				$("img").stop();//停止之前效果执行当前触发效果
				if(x > img_x){
					$("#img_r").attr("src","img/player_right.gif");
					// $("#img_r").attr("src","img/playerbig_right.gif");
					$("#img_r").animate({					
						left:x,
						top:y,
					},3000
					);					
				}else{
					$("#img_r").attr("src","img/player_left.gif");	
					// $("#img_r").attr("src","img/playerbig_left.gif");
					$("#img_r").animate({						
						left:x,
						top:y,
					},3000
					)
					// 179000910-陈润强
				}																
				console.log("网页" + x + ":" + y);
				console.log("图片" + img_x + ":" + img_y);						
			})
		})
	</script>
	<body>
		<div class="div1">
			<img src="img/player_right.gif" id="img_r" style="position: absolute;left: 45%;top: 30%;">
			<!-- <img src="img/playerbig_right.gif" id="imgb_r" style="position: absolute;display: none;">			 -->
			<img src="img/player1.gif" id="img1_r" style="position: absolute;top:75%;opacity: 80%;">
			<img src="img/player1_big.gif" id="imgb1_r" style="position: absolute;opacity: 80%;">
			
		</div>

	</body>
</html>
